<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link rel="stylesheet" href="${contextPath}/admin/stylesheets/common.css?v=${sversion}" />
    <link rel="stylesheet" href="${contextPath}/admin/stylesheets/table.css?v=${sversion}" />
</head>
<body>
    <div class="place">
        <span class="label-span">位置：</span>
        <ul id="place-list" class="place-ul">
            <li>
            	应用首页
            </li>
        </ul>
    </div>
    <div class="body-warp start-page">
        <div class="panel">
            <div class="panel-body">
            	<ul class="start-panel shortcut-list">
				</ul>
                <div class="start-panel system-info">
                    <p>
                        <span class="mr-10">
                            <i class="iconfont">&#xe624;</i>
                            <b><span class="text">${login_info.username}</span>您好，欢迎使用！</b>
                        </span>
                    </p>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="${contextPath}/ext/jquery/jquery-1.8.1.min.js"></script>
    <script>
        //单行个数
        var iconWidth = 0;
        var $dom = $('#app-list');
        var liNums = (function(){
            var listWidth = $dom.width();
            iconWidth = $dom.find('li').outerWidth() | 139;
            var liNums = parseInt(listWidth / iconWidth);

            return liNums;
        })();
        //每行宽度
        var width = liNums * iconWidth;

        $(function(){
            init();
            addListeners();
        });

        //初始化
        function init () {
            $dom.each(function(index, el) {
                var length = $(this).find('li').length;

                $(this).data({
                    'curPage': 1,
                    'totalPage': length % liNums === 0 ? length / liNums : parseInt(length / liNums) + 1
                });
            });
        }
        function addListeners () {
            $('.left-arrow').bind('click', function(event) {
                if($(this).hasClass('disabled')){
                    return false;
                }

                loadPage($dom.data('curPage') - 1, $(this));
            });
            $('.right-arrow').bind('click', function(event) {
                if($(this).hasClass('disabled')){
                    return false;
                }

                loadPage($dom.data('curPage') + 1, $(this));
            });
        }

        function loadPage (pageNum, $arrow){
            if(pageNum <= $dom.data('totalPage') && pageNum > 0){
                $dom.animate({
                    marginLeft: '-' + width * (pageNum - 1) + 'px'
                },'fast');
                $dom.data('curPage', pageNum);
            }

            var iconBlock = $dom.parents('.icon-block');

            if(pageNum === 1){
                iconBlock.find('.left-arrow').addClass('disabled');
            }else{
                iconBlock.find('.left-arrow').removeClass('disabled');
            }

            if(pageNum === $dom.data('totalPage')){
                iconBlock.find('.right-arrow').addClass('disabled');
            }else{
                iconBlock.find('.right-arrow').removeClass('disabled');
            }
        };
        
        
        function _syndata(){
        	var url ="${contextPath}/index/synData.ajax";
        	var post = {};
        	$.post(url,post,function(data){
        		if(data.s == 1){
        			alert("同步成功！");
        		}else{
        			alert(data.d||"同步失败！");
        		}
        	},"json");
        }
        
        function _export(exportType){
			window.location.href="${contextPath}/applyData/exportApplyData.ajax?exportType="+exportType;
		}
        
        
    </script>
</body>
</html>